//
//  CinemaTableViewCell.m
//  UI12豆瓣大项目
//
//  Created by dllo on 15/10/28.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "CinemaTableViewCell.h"

@implementation CinemaTableViewCell
- (void)dealloc
{
    [_activity release];
    [_titleLabel release];
    [_addressLabel release];
    [_telLabel release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        UIImageView *bgView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 10, 350, 120)];
        bgView.image = [UIImage imageNamed:@"bg_eventlistcell@2x"];
        [self.contentView addSubview:bgView];
        [bgView release];
        
        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 325, 30)];
        //        self.titleLabel.backgroundColor = [UIColor blackColor];
        self.titleLabel.text = @"题目";
        [bgView addSubview:self.titleLabel];
        [_titleLabel release];
        
        self.addressLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 40, 325, 30)];
        //        self.addressLabel.backgroundColor = [UIColor blackColor];
        self.addressLabel.text = @"地址";
        [bgView addSubview:self.addressLabel];
        [_addressLabel release];
        
        self.telLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 85, 325, 30)];
        //        self.telLabel.backgroundColor = [UIColor blackColor];
        self.telLabel.text = @"电话";
        [bgView addSubview:self.telLabel];
        [_telLabel release];
    }
    return self;
}

-(void)setActivity:(Activity *)activity{
    if (_activity != activity) {
        [_activity release];
        _activity = [activity retain];
    }
    self.titleLabel.text = self.activity.cinemaName;
    self.addressLabel.text = self.activity.address;
    self.telLabel.text = self.activity.telephone;
}
@end
